package com.heima.common.jackson;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
//解决精度丢失问题
@Configuration
public class InitJacksonConfig {
//想让他生效，让它被spring进行管理，需要在resources下的spring.factories加上com.heima.common.jackson.InitJacksonConfig
    @Bean
    public ObjectMapper objectMapper() {
        ObjectMapper objectMapper = new ObjectMapper();
        objectMapper = ConfusionModule.registerModule(objectMapper);
        return objectMapper;
    }

}
